# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=zabbix-agent2-plugin-alpine
pkgver=0.3.1
pkgrel=4
pkgdesc="Alpine related plugins for Zabbix Agent 2"
url="https://gitlab.alpinelinux.org/alpine/infra/zabbix-agent2-plugins"
arch="all"
license="MIT"
depends="zabbix-agent2"
makedepends="go"
source="https://gitlab.alpinelinux.org/alpine/infra/zabbix-agent2-plugins/-/archive/v$pkgver/zabbix-agent2-plugins-v$pkgver.tar.gz"
options="!check" # no test suite
builddir="$srcdir/zabbix-agent2-plugins-v$pkgver"
provides="zabbix-agent2-alpine=$pkgver-r$pkgrel"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build ./cmd/zabbix-agent2-plugin-alpine.go
}

package() {
	install -Dm0755 zabbix-agent2-plugin-alpine -t "$pkgdir"/usr/libexec
	install -Dm0644 config/alpine.conf \
		-t "$pkgdir"/etc/zabbix/zabbix_agent2.d/plugins.d/
}

sha512sums="
3376b363829b633242a93a5605f5602377704cc312d3d1ac8e61e9a0721fb816333a8ad4d1c68b458789c303b539f38bc3010aec94a6b38d05807836a373f67e  zabbix-agent2-plugins-v0.3.1.tar.gz
"
